package com.meijin.spring6.auto.service;

import com.meijin.spring6.auto.dao.UserDao;
import com.meijin.spring6.auto.dao.UserDaoImpl;

/**
 * @Author meijindeng
 * @Data 2023-09-03 18:38
 * @Description UserServiceImpl
 * @Version 1.0
 */
public class UserServiceImpl implements UserService {

    //2、在 service 中定义 dao 属性，生成该属性的 set 方法
    private UserDao userDao;

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public void addUserService() {
        System.out.println("userService方法执行了。。。");
        //调用 dao，原生写法
        /*UserDao userDao = new UserDaoImpl();
        userDao.addUserDao();*/
        userDao.addUserDao();
    }
}
